<<<<<<< HEAD
const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/market', {
	useNewUrlParser: true
});

const providerSchema = new mongoose.Schema({
	prov_code: String,
	prov_name: String,
	linkman: String,
	telephone: Number,
	fax: String,
	create_time: Date
});

const Provider = mongoose.model('provider', providerSchema);

module.exports = {
	Provider
};
=======
// 引入 "mongoose" 依赖
const mongoose = require('mongoose');
// 连接数据库：h51806
mongoose.connect('mongodb://localhost/h51806');

// Schema-数据结构：用户
const userSchema = new mongoose.Schema({
	username: String,
	password: String,
	email: String,
	regTime: Date
});

// Model-集合：用户
//在数据库中自动在'user'后加's'，集合名字变为'users'
const User = mongoose.model('user', userSchema); // 对应 "users" 集合
module.exports = {User}; 
>>>>>>> ef0d352149b975c18db4d09ca515364aa09d8c57
